<template>
  <div class="container">
    <ul class="mui-table-view">
        <li class="mui-table-view-cell mui-media" v-for="item in list">
            <router-link v-bind:to="'/news/newsinfo/' + item.id">
                <img class="mui-media-object mui-pull-left" v-bind:src="item.img_url">
                <div class="mui-media-body">
                    <p class='mui-ellipsis-2 mui-text-left'>{{item.title}}</p>
                    <p class='mui-ellipsis mui-text-left' v-html='item.zhaiyao'></p>    
                </div>
                <p class='primary'>
                    <span class='mui-pull-left'>发布时间:{{item.add_time | datefmt('YYYY-MM-DD HH:mm')}}</span>
                    <span class='mui-pull-right'>点击:{{item.click}}</span>
                </p>
            </router-link>
        </li>
        
    </ul>
  </div>
</template>
<script>
import { Toast } from 'mint-ui';
export default {
  created(){
    this.getList();
  },
  data(){
      return {list: []}
  },
  methods: {
      getList(){
          this.$http.get('http://www.lovegf.cn:8899/api/getnewslist').then(function(res){
            if(res.body.status != 0){
                Toast(res.body.message);
                return;
            }
            return this.list = res.body.message;
          })
      }
  }
}
</script>
<style scoped>
    .primary {
        color: #0094ff;
        margin-left: 80px;
        font-size: 10px;
    }
    .mui-table-view .mui-media-object {
        line-height: 80px;
        max-width: 80px;
        height: 80px;
    }
    .mui-ellipsis  {
        color: #999;
    }
</style>
